package cn.com.citydo.base.exception;

/**
 * @author jh
 * @date 2019/5/21 11:28
 * @Description: 自定义异常
 */

public class BizException  extends RuntimeException {

	private static final long serialVersionUID = 227070419120633050L;
	private int errorCode = ErrorCodeEnum.SYSTEM_PARAMS_ERROR.getCode();

	public BizException() {
	}

	public BizException(String message) {
		super(message);
	}

	public BizException(String message, Throwable cause) {
		super(message, cause);
	}

	public BizException(ErrorCodeEnum errorCodeEnum) {
		super(errorCodeEnum.getMsg());
		this.errorCode = errorCodeEnum.getCode();
	}

	public BizException(int errorCode, String errorMsg){
		super(errorMsg);
		this.errorCode = errorCode;
	}

	public int getErrorCode() {
		return errorCode;
	}
}

